package pers.vic.boot.console.config.i18n;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.i18n.SessionLocaleResolver;

import java.util.Locale;

/**
 * 描述:国际化配置文件
 * @author Vic.xu
 * @date 2021-12-10 9:10
 */
@Configuration
public class LocaleConfig {

    /**
     * 默认解析器， 默认语言为 CHINA
     * @return
     */
    @Bean(name = "localeResolver")
    public SessionLocaleResolver localeResolver() {
        System.err.println("localeResolver  init ");
        SessionLocaleResolver localeResolver = new SessionLocaleResolver();
        localeResolver.setDefaultLocale(Locale.CHINA);
        return localeResolver;
    }

}
